package com.ymatou.iapi.dglogin.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.dglogin.parameter.GetOpenIdByCodeBean;
import com.ymatou.iapi.dglogin.service.GetOpenIdByCodeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;

/**
*根据code,appname获取微信openidTest
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetOpenIdByCode{
	private static GetOpenIdByCodeBean getopenidbycodeBean;
	private static GetOpenIdByCodeCall getopenidbycodeCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据code,appname获取微信openidTest");
	}

	@Before
	public void caseUp() {
		getopenidbycodeBean=new GetOpenIdByCodeBean();
		getopenidbycodeCall=new GetOpenIdByCodeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getopenidbycodeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	//需要第三方联调
	public void Tc_GetOpenIdByCode_001() {
		Logger.start(true,"正确数据，成功");
		try {
			getopenidbycodeBean.setCode("123123");
			getopenidbycodeBean.setWxAppName("pcsqseller");
			
			getopenidbycodeCall.setData(getopenidbycodeBean);
			getopenidbycodeCall.callService();			
			Logger.verifyEquals("200", getopenidbycodeCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}